#ifndef SETMEMBERLEVEL_H
#define SETMEMBERLEVEL_H

#include <QDialog>
#include "personmember.h"

class InquireSql;

enum LastClickSetMemberLevel {lineEditMemberLevel, lineEditMemberDiscount,
                lineEditInitAmount, lineEditInitIntegration};

namespace Ui {
class SetMemberLevel;
}

class SetMemberLevel : public QDialog
{
    Q_OBJECT
    
public:
    explicit SetMemberLevel(QWidget *parent = 0);
    ~SetMemberLevel();
    void displayMemberLevel();
    bool eventFilter(QObject *target, QEvent *event);
    
private slots:
    void on_pushButtonNew_clicked();

    void on_tableWidgetMemberLevel_currentCellChanged(int currentRow, int currentColumn, int previousRow, int previousColumn);

    void on_pushButtonDelete_clicked();

    void on_pushButtonModify_clicked();

    void on_lineEditInitAmount_editingFinished();

    void on_lineEditMemberDiscount_editingFinished();

    void on_lineEditInitIntegration_editingFinished();

signals:
    void updateMemberLevel();

private:
    void setTableWidgetColor();
    void setTableWidgetHeaderStyle();
    void displayMemberLevelInformation(const PersonMember &);
    QString completionPrice(const QString &);
    Ui::SetMemberLevel *ui;
    InquireSql *m_sql;
    memberList m_currentTableWidgetList;
    int m_lastClick;
};

#endif // SETMEMBERLEVEL_H
